// dlib2.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"


#include <Windows.h>
#include <stdio.h>

int dllGlobalVar;

int add(int x, int y)
{
	return x + y;
}

BOOL APIENTRY DllMain(HANDLE hModule, DWORD  ul_reason_for_call,LPVOID lpReserved)
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		dllGlobalVar = 101;
		printf("\nprocess attach of dll");
		break;
	case DLL_THREAD_ATTACH:
		printf("\nthread attach of dll");
		break;
	case DLL_THREAD_DETACH:
		printf("\nthread detach of dll");
		break;
	case DLL_PROCESS_DETACH:
		printf("\nprocess detach of dll");
		break;
	}
	return TRUE;

}